module Comparador (LEDR,SW);
input		[8:0] SW;
output	[2:0]	LEDR;
reg      [2:0] LEDR; 
wire      [3:0] A;
wire 	    [3:0] B ;
assign  A=SW[4:1];
assign  B=SW[8:5];
 always @(*)
 begin
	if(SW[0]==1)
		begin
			if (A==B)
				LEDR	=	1 ;
			 else if(A>B)
				LEDR	=  2 ;
			 else	
				LEDR	=	4;
		end
	else
		LEDR	=	0;
end
endmodule 